package com.sims.service.impl;

import com.sims.dao.IStnUserDao;
import com.sims.dao.impl.StnUserDaoImp;
import com.sims.eo.StnUser;
import com.sims.service.IUserService;

public class UserServiceImp implements IUserService{
	IStnUserDao stnUserDao = new StnUserDaoImp();
	@Override
	public boolean validateLogin(String userAccount, String userPassword) {
		boolean  validated = false;
		//StnUser stnUser=stnUserDao.getUserbyAccount(userAccount);
		StnUser stnUser=stnUserDao.getUserbyAccount_jdbc(userAccount);
		//StnUser stnUser=stnUserDao.getUserbyAccount_dataSource(userAccount);
		if(stnUser != null){
			if(stnUser.getUserPassword() != null && stnUser.getUserPassword().equals(userPassword)){
				validated = true;
			}
		}
		return validated;
	}
}
